﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Quality.Migrations
{
    public partial class add_cancelstocks : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {

            migrationBuilder.DropColumn(
                name: "RetrievalId",
                table: "StoreStockContents");

            migrationBuilder.CreateTable(
                name: "CancellingStocksDocuments",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    CancellingStocksNo = table.Column<string>(nullable: true),
                    DeliveryNo = table.Column<string>(nullable: true),
                    StoreId = table.Column<Guid>(nullable: true),
                    StroeName = table.Column<string>(nullable: true),
                    AssemblyTaskNumber = table.Column<string>(nullable: true),
                    ReleaseOrder = table.Column<string>(nullable: true),
                    QualifiedNumber = table.Column<string>(nullable: true),
                    Model = table.Column<string>(nullable: true),
                    LotNo = table.Column<string>(nullable: true),
                    Cancelling = table.Column<int>(nullable: false),
                    CancellingReason = table.Column<string>(nullable: true),
                    CancellingUser = table.Column<string>(nullable: true),
                    CancellingUserId = table.Column<long>(nullable: false),
                    CancellingTime = table.Column<DateTime>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CancellingStocksDocuments", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "DeliveryOutRecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    DeliveryDocumentId = table.Column<Guid>(nullable: false),
                    StoreStockContentId = table.Column<Guid>(nullable: false),
                    LoadDetailsId = table.Column<Guid>(nullable: true),
                    ReleaseOrder = table.Column<string>(nullable: true),
                    QualifiedNumber = table.Column<string>(nullable: true),
                    ProductNumber = table.Column<string>(nullable: true),
                    OutboundStateDesc = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeliveryOutRecords", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CancellingStocksDocuments");

            migrationBuilder.DropTable(
                name: "DeliveryOutRecords");

            migrationBuilder.AddColumn<Guid>(
                name: "RetrievalId",
                table: "StoreStockContents",
                nullable: true);
        }
    }
}
